/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aitsm_superman;

import java.sql.Connection;
import java.sql.DriverManager;
import javax.swing.JOptionPane;

/**
 *
 * @author Administrator
 */
public class MyConnection {
    private Connection con;
    private String server,port,user,pass;
    private String url;
    public Connection getConnection(){
        try {
            server="THEWINNER\\SQLEXPRESS";
            port="1433";
            user="sa";
            pass="123";
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            url="jdbc:sqlserver://"+server+";database=AITSMSuperMan";
            con=DriverManager.getConnection(url,user,pass);
        } catch (Exception ex) {
            ex.printStackTrace();
            //JOptionPane.showInputDialog(null,"Please config sever");
        }
        return con;
    }
    
}
